package groovy.sample

class OneGroovyBean {
	// properties, like in Ruby, public getter/setter already created by default
	// but if required, one can write a old-fasion getter/setter to override the implicit default one
	Integer id
	String name
	Date dob

	// sample code
	static void main(args) {
			/*
			 * no need to define a constructor as below, because the below code is equivalent to(java):
			 * OneGroovyBean bean = new OneGroovyBean();
			 * bean.setId(1);
			 * bean.setName("Jeff");
			 * bean.setDob(new Date());
			 */
			def bean = new OneGroovyBean(id:1, name:"Jeff", dob:new Date())
			
			println("Hello ${bean.name}")
	}
}
